import React from 'react';
import PropTypes from 'prop-types';
import ThemeContext from '../assets/Theme';

class VoteHead extends React.Component {
	/*
	 * 获取上下文中的信息使用 
	 */
	/* static contextTypes = {
		title: PropTypes.string,
		supNum: PropTypes.number,
		oppNum: PropTypes.number
	}; */
	static contextType = ThemeContext;

	render() {
		let { title, supNum, oppNum } = this.context;

		return <header style={{
			background: 'lightblue'
		}}>
			<h3>{title}</h3>
			<span>N:{supNum + oppNum}</span>
		</header>;
	}
}
export default VoteHead;